@import "../../styles/colors";

.cm-datetime-value {
    display: block;
    position: relative;
    height: 32px;
    outline: 0;
    padding: 0 16px 0 6px;
    border: 1px solid @color-border;
    border-radius: 3px;
    color: @color-ctx;
    background-color: #fff;
    background-image: none;
    transition: all ease-in-out .15s;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.cm-datetime-text {
    display: block;
    height: 30px;
    line-height: 30px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.cm-datetime-clear,
.cm-datetime-cert{
    position: absolute;
    right: 8px;
    top: 8px;
    width: 16px;
    height: 14px;
    color: rgba(128, 134, 149, 0.5);
}

.cm-datetime-clear{
    font-size: 14px;
    display: none;
}

.cm-datetime{
    position: relative;
    &:hover{
        .cm-datetime-value{
            border-color: @color-blue;
        }
    }
    .cm-datetime-value:focus{
        border-color: @color-blue;
    }
}

.cm-datetime-wrap{
    margin: 5px 0;
    padding: 5px 0;
    background-color: #fff;
    box-sizing: border-box;
    border-radius: 4px;
    box-shadow: 0 1px 6px rgba(0,0,0,.2);
    position: absolute;
    z-index: 900;
    display: none;
    transform-origin: top center;
}

.cm-datetime.cm-datetime-open{
    .cm-datetime-wrap{
      display: block;
      animation: fadeInUp 0.2s;
      animation-fill-mode: both;
    }
}

@keyframes fadeInUp {
    from {
      opacity: 0;
      -webkit-transform: scaleY(0);
      transform: scaleY(0);
    }
  
    to {
      opacity: 1;
      -webkit-transform: scaleY(1);
      transform: scaleY(1);
    }
  }

.cm-datetime-disabled{
    &:hover .cm-datetime-value,
    .cm-datetime-value{
        border-color: @color-disabled;
        background-color: #f3f3f3;
        opacity: 1;
        cursor: not-allowed;
        color: #ccc;
    }
    .cm-datetime-value:focus{
        border-color: @color-disabled;
    }
}

.cm-datetime-small {
    .cm-datetime-value {
        height: 24px;
        line-height: 24px;
    }
    .cm-datetime-text{
        height: 22px;
        line-height: 22px;
    }
    .cm-datetime-clear,
    .cm-datetime-cert{
        top: 5px;
        font-size: 12px;
        height: 12px;
    }
}
.cm-datetime-large {
    .cm-datetime-value {
        height: 40px;
        line-height: 40px;
    }
    .cm-datetime-text{
        height: 38px;
        line-height: 38px;
    }
    .cm-datetime-clear,
    .cm-datetime-cert{
        top: 10px;
        font-size: 18px;
        height: 18px;
    }
}

.cm-datetime-clearable:hover{
    .cm-datetime-clear{
        display: inline-block;
    }
    .cm-datetime-cert{
        display: none;
      }
}
.cm-datetime-text-placeholder{
    color: @color-disabled;
}

.cm-datetime-has-shortcuts{
    .cm-date-picker{
        float: left;
        border-left: 1px solid @color-border;
    }
}
.cm-datetime-shortcuts{
    float: left;
    width: 80px;
    margin-left: -80px;
    padding: 5px;
    top: 0;
    bottom: 0;
    position: absolute;
    background: #f8f8f9;
    border-right: 1px solid #e8eaec;
    border-radius: 4px 0 0 4px;
    overflow: auto;
}
.cm-datetime-shortcut-item{
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid @color-border;
    border-radius: 3px;
    text-align: center;
    padding: 2px 0;
    cursor: pointer;
    margin-bottom: 5px;
    &:hover{
        border-color: @color-blue;
    }
}
.cm-datetime-has-shortcuts{
    .cm-datetime-wrap{
        padding-left: 80px;
    }
    .cm-date-picker{
        border-left: 0;
    }
}
.cm-datetime-tools{
    border-top: 1px solid #e8eaec;
    padding: 8px;
    clear: both;
}
.cm-datetime{
    .cm-time-picker-cell{
        min-width: 90px;
        ul li {
            padding-left: 40px;
        }
    }
}